/**
 * ServerUtilities.java
 * @author pkendzo
 * Email: pkendzo@msn.com
 * 2012
 */
package lu.med.praxiswahl.wahlumed.client.utilities;

import java.io.File;
import org.w3c.dom.Node;

/**
 * @author pkendzo
 * 
 */
public class ServerUtilities {
	private File file;

	public ServerUtilities() {
		this.file = new File(
				lu.med.praxiswahl.wahlumed.client.wclient.Main.PATH_PATH);
	}

	public String readSplashPath() {

		XMLReader reader = XMLReader.getPathConfigXMLReaderInstance(file);
		Node node = null;

		node = reader.getDoc().getElementsByTagName("SPLASH_PATH").item(0);
		return node.getChildNodes().item(0).getNodeValue();
	}

	public String readLetterHeaderLogoPath() {

		XMLReader reader = XMLReader.getPathConfigXMLReaderInstance(file);
		Node node = null;

		node = reader.getDoc().getElementsByTagName("PRINT_LOGO_LETTER_HEADER")
				.item(0);
		return node.getChildNodes().item(0).getNodeValue();

	}

	public String readMessageHeaderPath() {

		XMLReader reader = XMLReader.getPathConfigXMLReaderInstance(file);
		Node node = null;

		node = reader.getDoc().getElementsByTagName("PRINT_LOGO_MESSAGE")
				.item(0);
		return node.getChildNodes().item(0).getNodeValue();

	}

}
